package com.yida.wy.common.domain.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yida.wy.common.valid.Update;
import com.yida.wy.common.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 基础数据（楼栋）新增或修改DTO
 *
 * @author lqq
 * @date 2023-11-21
 */
@Data
@ApiModel(value = "基础数据（楼栋信息）新增或修改DTO")
public class WyBaseBuildAddUpdateRequest extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "楼栋名称（必填）")
    @NotBlank(message = "楼栋名称不能为空")
    private String buildName;

    @ApiModelProperty(value = "楼幢号")
    @NotBlank(message = "楼幢号不能为空")
    private String buildNo;

    @ApiModelProperty(value = "单元数量")
    @NotNull(message = "单元数量不能为空")
    private Integer unitTotal;

    @ApiModelProperty(value = "楼栋类型")
    private Integer buildType;

    @ApiModelProperty(value = "建筑总面积")
    @NotNull(message = "建筑总面积不能为空")
    private BigDecimal totalSize;

    @ApiModelProperty(value = "总层数")
    @NotNull(message = "总层数不能为空")
    private Integer totalLayer;

    @ApiModelProperty(value = "户数")
    @NotNull(message = "户数不能为空")
    private Integer totalOwner;

    @ApiModelProperty(value = "楼栋ID")
    @NotNull(groups = Update.class, message = "请求参数有误[buildId]为空")
    private Long buildId;

    @ApiModelProperty(value = "基础小区ID")
    @NotNull(message = "请求参数有误[communityId]为空")
    private Long communityId;

    @ApiModelProperty(value = "期房总面积")
    private BigDecimal periodSize;

    @ApiModelProperty(value = "其中住宅数")
    private Integer residence;

    @ApiModelProperty(value = "其中非住宅数")
    private Integer nonResidence;

    @ApiModelProperty(value = "地区ID")
    @NotNull(message = "请求参数有误[areaId]为空")
    private Long areaId;

    @ApiModelProperty(value = "街道ID")
    @NotNull(message = "请求参数有误[streetId]为空")
    private Long streetId;

    @ApiModelProperty(value = "银行ID")
    private Long bankId;

    @ApiModelProperty(value = "拉取数据时的自然幢标识码")
    private String buildCode;

    @ApiModelProperty(value = "是否为公用户(0=不是,1=是)")
    private String publicFlag;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "公用户创建日期")
    private Date publicCreateTime;

    @ApiModelProperty(value = "开发项目标识码")
    private String projectCode;

    @ApiModelProperty(value = "是否是导入自建楼盘 0不是 1是")
    private String importFlag;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "交付日期")
    private Date deliverDate;

    @ApiModelProperty("是否是外网")
    @NotNull(message = "请求参数有误[outsideFlag]为空")
    private Boolean outsideFlag;
}
